<div id="subPage" data-type="paperList" class="tpl-portlet-components">
    <div class="portlet-title">
      <div class="caption font-green bold">
        <span class="am-icon-code"></span>选题列表
      </div>
    </div>
    <div class="tpl-block">
      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-4">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" id="add" class="am-btn am-btn-default am-btn-success auth-show" auth-data="teacher"><span class="am-icon-plus"></span> 新增</button>
              <button onclick="exportData('subject/export')" type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span>导出</button>
              <button type="button" onclick="deleteAllData('/subject/dels')" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span>清空全部</button>
            </div>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-2">
          <div class="am-form-group">
            <select class="select-option" select-id="isSelect" data-am-selected="{btnSize: 'sm'}">
                <option value="all">全部</option>
                <option value="true">已确选</option>
                <option value="false">未确选</option>
            </select>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-2">
          <div class="am-form-group">
            <select class="select-option major-select-data" select-id="majorId"  data-am-selected="{btnSize: 'sm'}">
              <option value="all">全部</option>
            </select>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-input-group am-input-group-sm">
            <input type="text" id="search-input" class="am-form-field" placeholder="按照标题模糊查询">
            <span class="am-input-group-btn">
                <button id="search-submit" class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="button"></button>
            </span>
          </div>
        </div>
      </div>
      <div class="am-g">
        <div class="am-u-sm-12">
          <table class="am-table am-table-striped am-table-hover table-main">
            <thead>
              <tr>
                <th>教师</th>
                <th>题目</th>
                <th>面向专业</th>
                <th>选题人数</th>
                <th>是否确选</th>
                <th>确选人</th>
                <th>操作</th>
              </tr>
            </thead>
            <div id="data-list-input">
               <input type="hidden" class="data-list-input" name="isSelect" value="" />
               <input type="hidden" class="data-list-input" name="majorId" value="" />
            </div>
            <tbody id="data-list">


            </tbody>
          </table>
          <div class="am-cf">

            <div class="am-fr">
              <ul class="am-pagination tpl-pagination" id="data-list-page">

              </ul>
            </div>
          </div>
          <hr>
        </div>
      </div>
    </div>
    <div class="tpl-alert"></div>
  </div>
<div class="am-modal am-modal-prompt" tabindex="-1" id="select-stu" >
<div class="am-modal-dialog">
  <div class="am-modal-hd">系统提示</div>
  <div class="am-modal-bd" >
    输入需要指定的学生学号
    <input type="text" id="studentId" class="am-modal-prompt-input">
  </div>
  <div class="am-modal-footer">
    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
    <span class="am-modal-btn" data-am-modal-confirm >提交</span>
  </div>
</div>
</div>
  <script id="paperdataListTpl" type="text/html">
    <% for(var i=0;i<$data.length;i++){ %>
      <% if(i%2==0){%>
    <tr list-data-id="<%==$data[i].id%>">
      <td><%==$data[i].teacherName%></td>
      <td><a href="javascript:;" onclick="go('paper/detail.html?id=<%==$data[i].id%>')" ><%==$data[i].title%></a></td>
      <td><%==$data[i].majorName%></td>
      <td><%==$data[i].guysNum%></td>
      <%if($data[i].choose==1){%>
      <td style="color:green;">是</td>
      <%}else{%>
      <td style="color:red;">否</td>
      <%}%>
      <%if($data[i].stuName){%>
      <td><%==$data[i].stuName%></td>
      <%}else{%>
      <td ></td>
      <%}%>
      <td>
        <div class="am-btn-toolbar">
          <div class="am-btn-group am-btn-group-xs">
            <button onclick="go('paper/edit?id=<%==$data[i].id%>')" class="am-btn am-btn-default am-btn-xs am-text-secondary auth-show" auth-data="teacher" ><span class="am-icon-pencil-square-o"></span> 编辑</button>
            <button onclick="go('paper/student?id=<%==$data[i].id%>&title=<%==$data[i].title%>&state=<%==$data[i].choose%>')" class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>查看选题人</button>
            <button paper-id="<%==$data[i].id%>" <%if($data[i].choose==1) print("disabled")%>  onclick="openSelectTa('<%==$data[i].choose%>','<%==$data[i].majorId%>','<%==$data[i].id%>')"  class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>指定学生</button>
            <button onclick="deleteData('subject/del/<%==$data[i].id%>','<%==$data[i].id%>')" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>
          </div>
        </div>
      </td>
    </tr>
    <%}else if(i%2==1){%>
    <tr list-data-id="<%==$data[i].id%>">
      <td><%==$data[i].teacherName%></td>
      <td><a href="javascript:;" onclick="go('paper/detail?id=<%==$data[i].id%>')"><%==$data[i].title%></a></td>
      <td><%==$data[i].majorName%></td>
      <td><%==$data[i].guysNum%></td>
      <%if($data[i].choose==1){%>
      <td style="color:green;">是</td>
      <%}else{%>
      <td style="color:red;">否</td>
      <%}%>
      <%if($data[i].stuName){%>
      <td><%==$data[i].stuName%></td>
      <%}else{%>
      <td ></td>
      <%}%>
      <td>
        <div class="am-btn-toolbar">
          <div class="am-btn-group am-btn-group-xs">
            <button onclick="go('paper/edit?id=<%==$data[i].id%>')" class="am-btn am-btn-default am-btn-xs am-text-secondary auth-show" auth-data="teacher" ><span class="am-icon-pencil-square-o"></span> 编辑</button>
            <button onclick="go('paper/student?id=<%==$data[i].id%>&title=<%==$data[i].title%>&state=<%==$data[i].choose%>')"  class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>查看选题人</button>
            <button paper-id="<%==$data[i].id%>" <%if($data[i].choose==1) print("disabled")%> onclick="openSelectTa('<%==$data[i].choose%>','<%==$data[i].majorId%>','<%==$data[i].id%>')" class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>指定学生</button>
            <button onclick="deleteData('subject/del/<%==$data[i].id%>','<%==$data[i].id%>')" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>
          </div>
        </div>
      </td>
    </tr>
    <%}}%>
  </script>
  <script src="static/js/amazeui.min.js"></script>
